package com.lechuang.user.constants;

public class LoginConstants {

    /**rediskey*/
    public final static String REDIS_KEY = "mall:";

    /**登录key*/
    public final static String LOGIN_KEY = REDIS_KEY + "login:";

    /**注册key*/
    public final static String REGISTER_KEY = REDIS_KEY + "register:";

    /**忘记密码key*/
    public final static String FORGET_KEY = REDIS_KEY + "forget:";

    /**支付密码key*/
    public final static String PAY_KEY = REDIS_KEY + "pay:";

    /**token*/
    public final static String TOKEN_KEY = REDIS_KEY + "token:";

    /** 10分钟内错误次数*/
    public final static Integer ERR_NUM = 10;

    /** 1秒*/
    public final static long ONE_SECOND = 1;

    /**5分钟*/
    public final static long ONE_MINUTE = 60 * ONE_SECOND;

    /**10分钟 */
    public final static long TEN_MINUTE = 10 * ONE_MINUTE;

    /**1小时 */
    public final static long ONE_HOUR = 6 * TEN_MINUTE;

    /**1天 */
    public final static long ONE_DAY = 24 * ONE_HOUR;

    /**30天*/
    public final static long THIRTY_DAY = 30 * ONE_DAY;

    public static String getRedisKey(String token){
        return TOKEN_KEY + token;
    }
}
